3.187 \(\int \sec (e+f x) (a+a \sec (e+f x)) (c+d \sec (e+f x))^2 \, dx\)

Optimal. Leaf size=108 \[ \frac {2 a \left (c^2+3 c d+d^2\right ) \tan (e+f x)}{3 f}+\frac {a \left (2 c^2+2 c d+d^2\right ) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {a \tan (e+f x) (c+d \sec (e+f x))^2}{3 f}+\frac {a d (2 c+3 d) \tan (e+f x) \sec (e+f x)}{6 f} \]

[Out]

1/2*a*(2*c^2+2*c*d+d^2)*arctanh(sin(f*x+e))/f+2/3*a*(c^2+3*c*d+d^2)*tan(f*x+e)/f+1/6*a*d*(2*c+3*d)*sec(f*x+e)*
tan(f*x+e)/f+1/3*a*(c+d*sec(f*x+e))^2*tan(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.17, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {4002, 3997, 3787, 3770, 3767, 8} \[ \frac {2 a \left (c^2+3 c d+d^2\right ) \tan (e+f x)}{3 f}+\frac {a \left (2 c^2+2 c d+d^2\right ) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {a \tan (e+f x) (c+d \sec (e+f x))^2}{3 f}+\frac {a d (2 c+3 d) \tan (e+f x) \sec (e+f x)}{6 f} \]

Antiderivative was successfully verified.

[In]

Int[Sec[e + f*x]*(a + a*Sec[e + f*x])*(c + d*Sec[e + f*x])^2,x]

[Out]

(a*(2*c^2 + 2*c*d + d^2)*ArcTanh[Sin[e + f*x]])/(2*f) + (2*a*(c^2 + 3*c*d + d^2)*Tan[e + f*x])/(3*f) + (a*d*(2
*c + 3*d)*Sec[e + f*x]*Tan[e + f*x])/(6*f) + (a*(c + d*Sec[e + f*x])^2*Tan[e + f*x])/(3*f)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3787

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rule 3997

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.
) + (A_)), x_Symbol] :> -Simp[(b*B*Cot[e + f*x]*(d*Csc[e + f*x])^n)/(f*(n + 1)), x] + Dist[1/(n + 1), Int[(d*C
sc[e + f*x])^n*Simp[A*a*(n + 1) + B*b*n + (A*b + B*a)*(n + 1)*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f
, A, B}, x] && NeQ[A*b - a*B, 0] &&  !LeQ[n, -1]

Rule 4002

Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_))
, x_Symbol] :> -Simp[(B*Cot[e + f*x]*(a + b*Csc[e + f*x])^m)/(f*(m + 1)), x] + Dist[1/(m + 1), Int[Csc[e + f*x
]*(a + b*Csc[e + f*x])^(m - 1)*Simp[b*B*m + a*A*(m + 1) + (a*B*m + A*b*(m + 1))*Csc[e + f*x], x], x], x] /; Fr
eeQ[{a, b, A, B, e, f}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0]

Rubi steps

\begin {align*} \int \sec (e+f x) (a+a \sec (e+f x)) (c+d \sec (e+f x))^2 \, dx &=\frac {a (c+d \sec (e+f x))^2 \tan (e+f x)}{3 f}+\frac {1}{3} \int \sec (e+f x) (c+d \sec (e+f x)) (a (3 c+2 d)+a (2 c+3 d) \sec (e+f x)) \, dx\\ &=\frac {a d (2 c+3 d) \sec (e+f x) \tan (e+f x)}{6 f}+\frac {a (c+d \sec (e+f x))^2 \tan (e+f x)}{3 f}+\frac {1}{6} \int \sec (e+f x) \left (3 a \left (2 c^2+2 c d+d^2\right )+4 a \left (c^2+3 c d+d^2\right ) \sec (e+f x)\right ) \, dx\\ &=\frac {a d (2 c+3 d) \sec (e+f x) \tan (e+f x)}{6 f}+\frac {a (c+d \sec (e+f x))^2 \tan (e+f x)}{3 f}+\frac {1}{2} \left (a \left (2 c^2+2 c d+d^2\right )\right ) \int \sec (e+f x) \, dx+\frac {1}{3} \left (2 a \left (c^2+3 c d+d^2\right )\right ) \int \sec ^2(e+f x) \, dx\\ &=\frac {a \left (2 c^2+2 c d+d^2\right ) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {a d (2 c+3 d) \sec (e+f x) \tan (e+f x)}{6 f}+\frac {a (c+d \sec (e+f x))^2 \tan (e+f x)}{3 f}-\frac {\left (2 a \left (c^2+3 c d+d^2\right )\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (e+f x))}{3 f}\\ &=\frac {a \left (2 c^2+2 c d+d^2\right ) \tanh ^{-1}(\sin (e+f x))}{2 f}+\frac {2 a \left (c^2+3 c d+d^2\right ) \tan (e+f x)}{3 f}+\frac {a d (2 c+3 d) \sec (e+f x) \tan (e+f x)}{6 f}+\frac {a (c+d \sec (e+f x))^2 \tan (e+f x)}{3 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.43, size = 75, normalized size = 0.69 \[ \frac {a \left (3 \left (2 c^2+2 c d+d^2\right ) \tanh ^{-1}(\sin (e+f x))+\tan (e+f x) \left (2 \left (3 (c+d)^2+d^2 \tan ^2(e+f x)\right )+3 d (2 c+d) \sec (e+f x)\right )\right )}{6 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[e + f*x]*(a + a*Sec[e + f*x])*(c + d*Sec[e + f*x])^2,x]

[Out]

(a*(3*(2*c^2 + 2*c*d + d^2)*ArcTanh[Sin[e + f*x]] + Tan[e + f*x]*(3*d*(2*c + d)*Sec[e + f*x] + 2*(3*(c + d)^2
+ d^2*Tan[e + f*x]^2))))/(6*f)

________________________________________________________________________________________

fricas [A]  time = 0.48, size = 150, normalized size = 1.39 \[ \frac {3 \, {\left (2 \, a c^{2} + 2 \, a c d + a d^{2}\right )} \cos \left (f x + e\right )^{3} \log \left (\sin \left (f x + e\right ) + 1\right ) - 3 \, {\left (2 \, a c^{2} + 2 \, a c d + a d^{2}\right )} \cos \left (f x + e\right )^{3} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (2 \, a d^{2} + 2 \, {\left (3 \, a c^{2} + 6 \, a c d + 2 \, a d^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, {\left (2 \, a c d + a d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{12 \, f \cos \left (f x + e\right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))*(c+d*sec(f*x+e))^2,x, algorithm="fricas")

[Out]

1/12*(3*(2*a*c^2 + 2*a*c*d + a*d^2)*cos(f*x + e)^3*log(sin(f*x + e) + 1) - 3*(2*a*c^2 + 2*a*c*d + a*d^2)*cos(f
*x + e)^3*log(-sin(f*x + e) + 1) + 2*(2*a*d^2 + 2*(3*a*c^2 + 6*a*c*d + 2*a*d^2)*cos(f*x + e)^2 + 3*(2*a*c*d +
a*d^2)*cos(f*x + e))*sin(f*x + e))/(f*cos(f*x + e)^3)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))*(c+d*sec(f*x+e))^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)2/f*(-(2*a*c^2+2*a*c*d+a*d^2)/4*ln(abs(tan((f*x+exp(1))/2)-1))
+(2*a*c^2+2*a*c*d+a*d^2)/4*ln(abs(tan((f*x+exp(1))/2)+1))+(-6*tan((f*x+exp(1))/2)^5*a*c^2-6*tan((f*x+exp(1))/2
)^5*a*c*d-3*tan((f*x+exp(1))/2)^5*a*d^2+12*tan((f*x+exp(1))/2)^3*a*c^2+24*tan((f*x+exp(1))/2)^3*a*c*d+4*tan((f
*x+exp(1))/2)^3*a*d^2-6*tan((f*x+exp(1))/2)*a*c^2-18*tan((f*x+exp(1))/2)*a*c*d-9*tan((f*x+exp(1))/2)*a*d^2)*1/
6/(tan((f*x+exp(1))/2)^2-1)^3)

________________________________________________________________________________________

maple [A]  time = 1.11, size = 174, normalized size = 1.61 \[ \frac {a \,c^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {2 a c d \tan \left (f x +e \right )}{f}+\frac {a \,d^{2} \sec \left (f x +e \right ) \tan \left (f x +e \right )}{2 f}+\frac {a \,d^{2} \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2 f}+\frac {a \,c^{2} \tan \left (f x +e \right )}{f}+\frac {a c d \sec \left (f x +e \right ) \tan \left (f x +e \right )}{f}+\frac {a c d \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{f}+\frac {2 a \,d^{2} \tan \left (f x +e \right )}{3 f}+\frac {a \,d^{2} \tan \left (f x +e \right ) \left (\sec ^{2}\left (f x +e \right )\right )}{3 f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(a+a*sec(f*x+e))*(c+d*sec(f*x+e))^2,x)

[Out]

1/f*a*c^2*ln(sec(f*x+e)+tan(f*x+e))+2/f*a*c*d*tan(f*x+e)+1/2/f*a*d^2*sec(f*x+e)*tan(f*x+e)+1/2/f*a*d^2*ln(sec(
f*x+e)+tan(f*x+e))+a*c^2*tan(f*x+e)/f+1/f*a*c*d*sec(f*x+e)*tan(f*x+e)+1/f*a*c*d*ln(sec(f*x+e)+tan(f*x+e))+2/3/
f*a*d^2*tan(f*x+e)+1/3/f*a*d^2*tan(f*x+e)*sec(f*x+e)^2

________________________________________________________________________________________

maxima [A]  time = 0.47, size = 165, normalized size = 1.53 \[ \frac {4 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a d^{2} - 6 \, a c d {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 3 \, a d^{2} {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 12 \, a c^{2} \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) + 12 \, a c^{2} \tan \left (f x + e\right ) + 24 \, a c d \tan \left (f x + e\right )}{12 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))*(c+d*sec(f*x+e))^2,x, algorithm="maxima")

[Out]

1/12*(4*(tan(f*x + e)^3 + 3*tan(f*x + e))*a*d^2 - 6*a*c*d*(2*sin(f*x + e)/(sin(f*x + e)^2 - 1) - log(sin(f*x +
 e) + 1) + log(sin(f*x + e) - 1)) - 3*a*d^2*(2*sin(f*x + e)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log
(sin(f*x + e) - 1)) + 12*a*c^2*log(sec(f*x + e) + tan(f*x + e)) + 12*a*c^2*tan(f*x + e) + 24*a*c*d*tan(f*x + e
))/f

________________________________________________________________________________________

mupad [B]  time = 4.76, size = 196, normalized size = 1.81 \[ \frac {a\,\mathrm {atanh}\left (\frac {2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (2\,c^2+2\,c\,d+d^2\right )}{4\,c^2+4\,c\,d+2\,d^2}\right )\,\left (2\,c^2+2\,c\,d+d^2\right )}{f}-\frac {\left (2\,a\,c^2+2\,a\,c\,d+a\,d^2\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+\left (-4\,a\,c^2-8\,a\,c\,d-\frac {4\,a\,d^2}{3}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\left (2\,a\,c^2+6\,a\,c\,d+3\,a\,d^2\right )\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((a + a/cos(e + f*x))*(c + d/cos(e + f*x))^2)/cos(e + f*x),x)

[Out]

(a*atanh((2*tan(e/2 + (f*x)/2)*(2*c*d + 2*c^2 + d^2))/(4*c*d + 4*c^2 + 2*d^2))*(2*c*d + 2*c^2 + d^2))/f - (tan
(e/2 + (f*x)/2)*(2*a*c^2 + 3*a*d^2 + 6*a*c*d) + tan(e/2 + (f*x)/2)^5*(2*a*c^2 + a*d^2 + 2*a*c*d) - tan(e/2 + (
f*x)/2)^3*(4*a*c^2 + (4*a*d^2)/3 + 8*a*c*d))/(f*(3*tan(e/2 + (f*x)/2)^2 - 3*tan(e/2 + (f*x)/2)^4 + tan(e/2 + (
f*x)/2)^6 - 1))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ a \left (\int c^{2} \sec {\left (e + f x \right )}\, dx + \int c^{2} \sec ^{2}{\left (e + f x \right )}\, dx + \int d^{2} \sec ^{3}{\left (e + f x \right )}\, dx + \int d^{2} \sec ^{4}{\left (e + f x \right )}\, dx + \int 2 c d \sec ^{2}{\left (e + f x \right )}\, dx + \int 2 c d \sec ^{3}{\left (e + f x \right )}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))*(c+d*sec(f*x+e))**2,x)

[Out]

a*(Integral(c**2*sec(e + f*x), x) + Integral(c**2*sec(e + f*x)**2, x) + Integral(d**2*sec(e + f*x)**3, x) + In
tegral(d**2*sec(e + f*x)**4, x) + Integral(2*c*d*sec(e + f*x)**2, x) + Integral(2*c*d*sec(e + f*x)**3, x))

________________________________________________________________________________________